#!/bin/bash

#source /home/ubuntu/app/pawdyll-llm/.image_versions

docker stop pawdyllLLM
docker rm pawdyllLLM

docker stop nginx
docker rm nginx

docker run --network host --restart=always -d \
    -p 8000:8000 \
    -v "/etc/hosts:/etc/hosts" \
    -w "/app" \
    -e PYTHONUNBUFFERED=1 \
    -e TZ=Asia/Shanghai \
    -v /etc/localtime:/etc/localtime:ro \
    -v /etc/timezone:/etc/timezone:ro \
    -v /home/ubuntu/logs/llm:/app/logs \
    --name pawdyllLLM \
    "pawdyll-llm"


docker run --name nginx -d -p 80:80 -p 443:443 \
    -v /home/ubuntu/config/nginx/nginx.conf:/etc/nginx/nginx.conf \
    -v /home/ubuntu/data/nginx/conf.d:/etc/nginx/conf.d \
    -v /home/ubuntu/config/sslkey:/home/ubuntu/ssl \
    -v /home/ubuntu/logs/nginx:/var/log/nginx \
    --privileged=true \
    nginx
